<div class="ibox">
	<div class="ibox-content">
		<form class="form-horizontal" id="addForm" action="${cxt!}/cms/stationMessage/add" method="POST" >
           <div class="form-group">
	             <label for="namebasic" class="col-md-2 control-label">${_res["stationMessage.messageTitle"]}<span class="fontColorRed">&nbsp;*</span></label>
	             <div class="col-md-8">
	              	<input type="text" class="form-control" name="stationMessage.title" placeholder="${_res['stationMessage.title']}"  required aria-required="true">
	             </div>
           </div>
            
           <div class="hr-line-dashed"></div>
           <div class="form-group">
		          <label class="col-md-2 control-label">${_res["stationMessage.sendObject"]}<span class="fontColorRed">&nbsp;*</span></label>
                <div class="col-md-8">
                    <#dict type="select" id="example-collapse" multiple="multiple"  empty="false" name="stationMessageSelects" table="customer_role" filedName="name" filedValue="id"  />
                    <input type="hidden" name="stationMessage.sendobject" id="sendObject" required="true">
                </div>	
		    </div>
		    
		   	<div class="hr-line-dashed"></div>
		    <div class="form-group">
		         <label  class="col-md-2 control-label">${_res["stationMessage.sendTime"]}<span class="fontColorRed">&nbsp;*</span></label>
		         <div class="col-md-6">
		         	<input class="form-control layer-date laydate-icon" name="stationMessage.sendtime"  placeholder="${_res['stationMessage.sendTime']}" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"  required aria-required="true">
		         </div>
		    </div>
		    
		    <div class="hr-line-dashed"></div>

			<label>${_res["stationMessage.content"]}<span class="fontColorRed">&nbsp;*</span></label>
			<script id="container" name="stationMessage.content" type="text/plain" style="width:100%; min-height:500px !important"></script>
					
			<div class="hr-line-dashed"></div>
				
			<div class="form-group">
				<div class="row">
					<div class="col-md-10 col-md-offset-2">
							<button type="button" class="btn btn-warning" onClick="ajaxContent('/cms/stationMessage/list')">${_res["system.return"]}</button>
							<button type="submit" class="btn btn-primary">${_res["system.save"]}</button>
	                		<button type="button" class="btn btn-danger" onClick="ajaxContent('/cms/stationMessage/list');">${_res["system.cancel"]}</button>
					</div>
				</div>
			</div>
		</form>
	</div>
</div>
<#submit  formId="addForm"  divId="content" />
<#nav />

<script>  
	/*加载富文本输入框*/
	$(document).ready(function() {
		var editor = new UE.ui.Editor();  
	    editor.render("container");
	});
	
	
	
	//multiselect
    $(document).ready(function() {
    	var multiArrs = new Array();
        $('#example-collapse').multiselect({
        	buttonWidth: '730px',
        	numberDisplayed: 8,
        	includeSelectAllOption: true,
        	onSelectAll: function(checked) {
        		if(checked === true){
	        		$('#example-collapse').each(function(){
	        		    $("#sendObject").val($(this).val());
	        		 });
        		}else if (checked === false) {
        			$("#sendObject").val("");
            	}
        		
        	},
            onChange: function(element, checked) {
            	if(checked === true){
            		multiArrs.push(element.val());
            	}else if (checked === false) {
            		multiArrs.remove(element.val());
            	}
            	$("#sendObject").val(multiArrs.join(","));
                
            }
        });
        
    });	
</script>